package cn.ht.jywrwater.module.ht.dal.mysql.waterqualityfactor;

import java.util.*;

import cn.ht.jywrwater.framework.common.pojo.PageResult;
import cn.ht.jywrwater.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.ht.jywrwater.framework.mybatis.core.mapper.BaseMapperX;
import cn.ht.jywrwater.module.ht.dal.dataobject.waterqualityfactor.WaterQualityFactorDO;
import org.apache.ibatis.annotations.Mapper;
import cn.ht.jywrwater.module.ht.controller.admin.waterqualityfactor.vo.*;

/**
 * 水质因子 Mapper
 *
 * @author hzx
 */
@Mapper
public interface WaterQualityFactorMapper extends BaseMapperX<WaterQualityFactorDO> {

    default PageResult<WaterQualityFactorDO> selectPage(WaterQualityFactorPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WaterQualityFactorDO>()
                .eqIfPresent(WaterQualityFactorDO::getWaterQualityFactorCode, reqVO.getWaterQualityFactorCode())
                .likeIfPresent(WaterQualityFactorDO::getWaterQualityFactorName, reqVO.getWaterQualityFactorName())
                .betweenIfPresent(WaterQualityFactorDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WaterQualityFactorDO::getId));
    }

    default List<WaterQualityFactorDO> selectList(WaterQualityFactorExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<WaterQualityFactorDO>()
                .eqIfPresent(WaterQualityFactorDO::getWaterQualityFactorCode, reqVO.getWaterQualityFactorCode())
                .likeIfPresent(WaterQualityFactorDO::getWaterQualityFactorName, reqVO.getWaterQualityFactorName())
                .betweenIfPresent(WaterQualityFactorDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WaterQualityFactorDO::getId));
    }

}
